Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds Sphinx documentation configuration by setting the project name, version, and release information. The changes import the health_check module to extract version details from its VERSION tuple and version string attribute.
- Adds project name, version, and release configuration to Sphinx docs
- Imports health_check module to access version information dynamically
- Constructs short version string from VERSION tuple (major.minor format)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,2 +1,7 @@ | |||
| import health_check | |||
|
|
|||
| project = "Django HealthCheck" | |||
There was a problem hiding this comment.
The project name "Django HealthCheck" is inconsistent with the project's established naming convention. Throughout the codebase (README.md, docs/index.rst, pyproject.toml), the project is consistently referred to as "django-health-check". Consider using "django-health-check" instead to maintain consistency with the project's branding and documentation.
| project = "Django HealthCheck" | |
| project = "django-health-check" |
| import health_check | ||
|
|
||
| project = "Django HealthCheck" | ||
| version = f"{health_check.VERSION[0]}.{health_check.VERSION[1]}" |
There was a problem hiding this comment.
Accessing VERSION tuple elements by index without validation could fail if the version tuple has fewer than 2 elements. While setuptools_scm typically generates version tuples with at least major and minor components, it's safer to handle edge cases. Consider adding validation or using a more defensive approach, such as checking the tuple length first or using try-except to handle potential IndexError.
| version = f"{health_check.VERSION[0]}.{health_check.VERSION[1]}" | |
| version_info = getattr(health_check, "VERSION", None) | |
| if isinstance(version_info, (tuple, list)) and len(version_info) >= 2: | |
| version = f"{version_info[0]}.{version_info[1]}" | |
| else: | |
| version = getattr(health_check, "__version__", "") |
No description provided.